{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "% matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import os\n",
    "import random\n",
    "import glob\n",
    "from skimage.feature import hog\n",
    "from PIL import Image\n",
    "# import cv2\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import accuracy_score\n",
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "from sklearn import svm\n",
    "from sklearn.metrics import confusion_matrix\n",
    "import itertools"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "test_file_dir = './imageData/行书/齐/敬世江敬世江0.jpg'\n",
    "img = Image.open(test_file_dir).resize((200,200)).convert('L')\n",
    "a = list(img.getdata())\n",
    "b = np.reshape(a,(200,200))\n",
    "\n",
    "features,img_h = hog(b, orientations=4, pixels_per_cell=(6,6),cells_per_block=(1,1),visualise=True)\n",
    "\n",
    "plt.axis('off')\n",
    "plt.imshow(img_h, cmap=plt.cm.gray)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeoAAAEICAYAAACQ4bezAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsvXmUXNd52Pm7tVd1de1d6AXdjcYOgjAJgqRI0TEljiay\nKNuMYyWj8ViJbM8knozjmZxJ7MzEmeM4cTzJyYkzSew4JzkzieXYkSwpphM7tmVLlAgJokgQIkES\nBNFYu9Fb7UvX+urd+ePVu6hq9Ar0Ut19f+fgoPq+7dar9+53v+9+i5BSotFoNBqNpjdx7HQHNBqN\nRqPRrIwW1BqNRqPR9DBaUGs0Go1G08NoQa3RaDQaTQ+jBbVGo9FoND2MFtQajUaj0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AQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11c986bd0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "image = Image.open(test_file_dir).resize((200,200)).convert('L')\n",
    "\n",
    "features, hog_image = hog(image, orientations=4, pixels_per_cell=(6,6),cells_per_block=(1,1),visualise=True)\n",
    "\n",
    "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4), sharex=True, sharey=True)\n",
    "\n",
    "ax1.axis('off')\n",
    "ax1.imshow(image, cmap=plt.cm.gray)\n",
    "ax1.set_title('Input image')\n",
    "ax1.set_adjustable('box-forced')\n",
    "\n",
    "# Rescale histogram for better display\n",
    "hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 0.02))\n",
    "\n",
    "ax2.axis('off')\n",
    "ax2.imshow(hog_image_rescaled, cmap=plt.cm.gray)\n",
    "ax2.set_title('Histogram of Oriented Gradients')\n",
    "ax1.set_adjustable('box-forced')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# return nohiden files dir\n",
    "def listdir_nohidden(path):\n",
    "    return glob.glob(os.path.join(path, '*'))\n",
    "\n",
    "# get hog features\n",
    "def image_reader(file_name,new_size):\n",
    "    # read images\n",
    "    # resize it \n",
    "    # set to grayscale\n",
    "    # (optional) get hog features\n",
    "    img = Image.open(file_name).resize(new_size).convert('L')\n",
    "    img = list(img.getdata())\n",
    "    img = np.reshape(img,(100,100))\n",
    "    return img\n",
    "\n",
    "# get file name and label list from disk\n",
    "def get_file_hog_label_list_from_disk():\n",
    "    char_styles = ['篆书','隶书','楷书','行书','草书']\n",
    "    # fileNamesList and fileLabelList\n",
    "    fileFeaturesList = []\n",
    "    fileLabelList = []\n",
    "    # iterate all styles\n",
    "    for style in char_styles:\n",
    "        print 'start iterate: %s'% style\n",
    "        # iterate all chars under this style\n",
    "        for chars in listdir_nohidden('./imageData/'+ style):\n",
    "            # there is at least one item \n",
    "            if len(listdir_nohidden(chars)) > 0:\n",
    "                # just get the first font images under this chars\n",
    "                char_item =  listdir_nohidden(chars)[0]                \n",
    "                img = image_reader(char_item,(100,100))\n",
    "                features = hog(img, orientations=4, pixels_per_cell=(6,6),cells_per_block=(1,1))\n",
    "                features = list(features)\n",
    "                print 'saving : ' + char_item\n",
    "                fileFeaturesList.append(features)\n",
    "                # fileFeaturesList.append(char_item)\n",
    "                fileLabelList.append(char_styles.index(style))\n",
    "            else:\n",
    "                print 'there is no img under dir: ' + chars\n",
    "                continue\n",
    "                \n",
    "    return fileFeaturesList,fileLabelList\n",
    "           "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# def plot_confusion_matrix(cm, classes,\n",
    "#                           normalize=False,\n",
    "#                           title='Confusion matrix',\n",
    "#                           cmap=plt.cm.Blues):\n",
    "#     \"\"\"\n",
    "#     This function prints and plots the confusion matrix.\n",
    "#     Normalization can be applied by setting `normalize=True`.\n",
    "#     \"\"\"\n",
    "#     plt.imshow(cm, interpolation='nearest', cmap=cmap)\n",
    "#     plt.title(title)\n",
    "#     plt.colorbar()\n",
    "#     tick_marks = np.arange(len(classes))\n",
    "#     plt.xticks(tick_marks, classes, rotation=45)\n",
    "#     plt.yticks(tick_marks, classes)\n",
    "\n",
    "#     if normalize:\n",
    "#         cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n",
    "#         print(\"Normalized confusion matrix\")\n",
    "#     else:\n",
    "#         print('Confusion matrix, without normalization')\n",
    "\n",
    "#     print(cm)\n",
    "\n",
    "#     thresh = cm.max() / 2.\n",
    "#     for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):\n",
    "#         plt.text(j, i, cm[i, j],\n",
    "#                  horizontalalignment=\"center\",\n",
    "#                  color=\"white\" if cm[i, j] > thresh else \"black\")\n",
    "\n",
    "#     plt.tight_layout()\n",
    "#     plt.ylabel('True label')\n",
    "#     plt.xlabel('Predicted label')\n",
    "\n",
    "# # train the model\n",
    "# # frist we use svm\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "fileFeaturesList,fileLabelList = get_file_hog_label_list_from_disk()\n",
    "x_train,x_test,y_train,y_test  = train_test_split(fileFeaturesList,fileLabelList,\n",
    "                                                  test_size=0.25,random_state=42)\n",
    "\n",
    "\n",
    "\n",
    "cls = svm.SVC()\n",
    "cls.fit(x_train,y_train)\n",
    "predictLabels = cls.predict(x_test)\n",
    "\n",
    "print  \"svm acc:%s\" % accuracy_score(y_test,predictLabels)\n",
    "\n",
    "\n",
    "neigh = KNeighborsClassifier(n_neighbors=3)\n",
    "neigh.fit(x_train,y_train)\n",
    "predictLabels = neigh.predict(x_test)\n",
    "print  \"KNN acc:%s\" % accuracy_score(y_test,predictLabels)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
